package uy.com.csi.gestpro.model.mantenimiento;

import java.io.Serializable;
import java.util.List;

import javax.persistence.*;

import uy.com.csi.gestpro.model.proyecto.GpCmpra;
import uy.com.csi.gestpro.model.proyecto.GpDstrbcion;

/**
 * The persistent class for the gp_undad_mdda database table.
 * 
 */
@Entity
@Table(name = "gp_undad_mdda", schema = "mantenimiento")
@NamedQuery(name = "GpUndadMdda.findAll", query = "SELECT g FROM GpUndadMdda g")
public class GpUndadMdda implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private Integer id;

	private String indcdor;

	private String nmbre;

	@OneToMany(mappedBy="gpUndadMdda")
	private List<GpDstrbcion> gpDstrbcions;
	
	@OneToMany(mappedBy="gpUndadMdda")
	private List<GpCmpra> gpCmpras;
	
	public GpUndadMdda() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getIndcdor() {
		return this.indcdor;
	}

	public void setIndcdor(String indcdor) {
		this.indcdor = indcdor;
	}

	public String getNmbre() {
		return this.nmbre;
	}

	public void setNmbre(String nmbre) {
		this.nmbre = nmbre;
	}

	public List<GpDstrbcion> getGpDstrbcions() {
		return gpDstrbcions;
	}

	public void setGpDstrbcions(List<GpDstrbcion> gpDstrbcions) {
		this.gpDstrbcions = gpDstrbcions;
	}

	public List<GpCmpra> getGpCmpras() {
		return gpCmpras;
	}

	public void setGpCmpras(List<GpCmpra> gpCmpras) {
		this.gpCmpras = gpCmpras;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GpUndadMdda other = (GpUndadMdda) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

}